home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / SRC / GEMLIB38.LZH / a_appl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-10  |  3.9 KB  |  193 lines

  1. /*
  2.  * Aes application library interface
  3.  *
  4.  * ++jrb bammi@cadence.com
  5.  * modified: mj -- ntomczak@vm.ucs.ualberta.ca
  6.  * modified: cg -- d2cg@dtek.chalmers.se
  7.  * modified: cf -- felsch.tu-harburg.de
  8.  */
  9. #include <string.h>
  10. #include "gem.h"
  11.  
  12.  
  13. int appl_bvset(int bvdisk, int bvhard)
  14. {
  15.     aes_intin[0] = bvdisk;
  16.     aes_intin[1] = bvhard;
  17.     aes_control[0] = 16;
  18.     aes_control[1] = 2;
  19.     aes_control[2] = 1;
  20.     aes_control[3] = 0;
  21.     aes_control[4] = 0;
  22.     aes(&aes_params);
  23.     return aes_intout[0];
  24. }
  25.  
  26.  
  27. int appl_control(int ap_cid, int ap_cwhat, void *ap_cout)
  28. {
  29.     aes_intin[0] = ap_cid;
  30.     aes_intin[1] = ap_cwhat;
  31.     aes_addrin[0] = (long)ap_cout;
  32.     aes_control[0] = 129;
  33.     aes_control[1] = 2;
  34.     aes_control[2] = 1;
  35.     aes_control[3] = 1;
  36.     aes_control[4] = 0;
  37.     aes(&aes_params);
  38.     return aes_intout[0];
  39. }
  40.  
  41.  
  42. int appl_exit(void)
  43. {
  44.     aes_control[0] = 19;
  45.     aes_control[1] = 0;
  46.     aes_control[2] = 1;
  47.     aes_control[3] = 0;
  48.     aes_control[4] = 0;
  49.     aes(&aes_params);
  50.     return aes_intout[0];
  51. }
  52.  
  53.  
  54. int appl_find(char *Name)
  55. {
  56.     aes_addrin[0] = (long)Name;
  57.     aes_control[0] = 13;
  58.     aes_control[1] = 0;
  59.     aes_control[2] = 1;
  60.     aes_control[3] = 1;
  61.     aes_control[4] = 0;
  62.     aes(&aes_params);
  63.     return aes_intout[0];
  64. }
  65.  
  66.  
  67. int appl_getinfo(int type, int *out1, int *out2, int *out3, int *out4)
  68. {
  69.     aes_intin[0] = type;
  70.     aes_control[0] = 130;
  71.     aes_control[1] = 1;
  72.     aes_control[2] = 5;
  73.     aes_control[3] = 0;
  74.     aes_control[4] = 0;
  75.     aes(&aes_params);
  76.     *out1 = aes_intout[1];
  77.     *out2 = aes_intout[2];
  78.     *out3 = aes_intout[3];
  79.     *out4 = aes_intout[4];
  80.     return aes_intout[0];
  81. }
  82.  
  83.  
  84. int appl_init(void)
  85. {
  86.     /* clear all binding arrays */
  87.     /* other binding arrays are synonyms for the stuff */
  88.     /* listed below - c.f. "common.h"                 */
  89.     bzero(&aes_control[0], AES_CTRLMAX * sizeof(short));
  90.     bzero(&aes_intin[0],    AES_INTINMAX * sizeof(short));
  91.     bzero(&aes_intout[0],    AES_INTOUTMAX * sizeof(short));
  92.     bzero(&aes_addrin[0],    AES_ADDRINMAX * sizeof(short));
  93.     bzero(&aes_addrout[0], AES_ADDROUTMAX * sizeof(short));
  94.     bzero(&aes_global[0],    AES_GLOBMAX * sizeof(short));
  95.  
  96.     aes_control[0] = 10;
  97.     aes_control[1] = 0;
  98.     aes_control[2] = 1;
  99.     aes_control[3] = 0;
  100.     aes_control[4] = 0;
  101.     aes(&aes_params);
  102.     gl_ap_version = aes_global[0];
  103.     gl_apid = aes_intout[0];
  104.     return aes_intout[0];
  105. }
  106.  
  107.  
  108. int appl_read(int ApId, int Length, void *ApPbuff)
  109. {
  110.     aes_intin[0] =  ApId;
  111.     aes_intin[1] = Length;
  112.     aes_addrin[0] = (long)ApPbuff;
  113.     aes_control[0] = 11;
  114.     aes_control[1] = 2;
  115.     aes_control[2] = 1;
  116.     aes_control[3] = 1;
  117.     aes_control[4] = 0;
  118.     aes(&aes_params);
  119.     return aes_intout[0];
  120. }
  121.  
  122.  
  123. int appl_search(int mode, char *fname, int *type, int *ap_id)
  124. {
  125.       aes_intin[0] = mode;
  126.       aes_addrin[0] = (long)fname;
  127.     aes_control[0] = 18;
  128.     aes_control[1] = 1;
  129.     aes_control[2] = 3;
  130.     aes_control[3] = 1;
  131.     aes_control[4] = 0;
  132.     aes(&aes_params);
  133.       *type = aes_intout[1];
  134.       *ap_id = aes_intout[2];
  135.       return aes_intout[0];
  136. }
  137.  
  138.  
  139. int appl_tplay(void *Mem, int Num, int Scale)
  140. {
  141.     aes_intin[0] =    Num;
  142.     aes_intin[1] =    Scale;
  143.     aes_addrin[0] = (long)Mem;
  144.     aes_control[0] = 14;
  145.     aes_control[1] = 2;
  146.     aes_control[2] = 1;
  147.     aes_control[3] = 1;
  148.     aes_control[4] = 0;
  149.     aes(&aes_params);
  150.     return aes_intout[0];
  151. }
  152.  
  153.  
  154. int appl_trecord(void *Mem, int Count)
  155. {
  156.     aes_intin[0] = Count;
  157.     aes_addrin[0] = (long)Mem;
  158.     aes_control[0] = 15;
  159.     aes_control[1] = 1;
  160.     aes_control[2] = 1;
  161.     aes_control[3] = 1;
  162.     aes_control[4] = 0;
  163.     aes(&aes_params);
  164.     return aes_intout[0];
  165. }
  166.  
  167.  
  168. int appl_write(int ApId, int Length, void *ApPbuff)
  169. {
  170.     aes_intin[0] = ApId;
  171.     aes_intin[1] = Length;
  172.     aes_addrin[0] = (long)ApPbuff;
  173.     aes_control[0] = 12;
  174.     aes_control[1] = 2;
  175.     aes_control[2] = 1;
  176.     aes_control[3] = 1;
  177.     aes_control[4] = 0;
  178.     aes(&aes_params);
  179.     return aes_intout[0];
  180. }
  181.  
  182.  
  183. int appl_yield(void)
  184. {
  185.     aes_control[0] = 17;
  186.     aes_control[1] = 0;
  187.     aes_control[2] = 1;
  188.     aes_control[3] = 0;
  189.     aes_control[4] = 0;
  190.     aes(&aes_params);
  191.     return aes_intout[0]; 
  192. }
  193.